package com.tte.common.service.impl;

import com.tte.common.anno.DictConver.UserVo;
import com.tte.common.mapper.UserMapper;
import com.tte.common.model.po.User;
import com.tte.common.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户实现类
 * @Author: DongWH
 * @Date: 2022/4/24 16:42
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        return userMapper.selectByloginAndPass(user);
    }

    @Override
    public List<UserVo> getAllUser() {
        List<UserVo> all = userMapper.getAll();
        return all;
    }

    @Override
    public UserVo getUserById(String id) {
        UserVo user = userMapper.selectUserVoById(id);
        return user;
    }

}
